package com.vietnam.power.persitence;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.*;

/**
 * The persistent class for the txn_product database table.
 * 
 */
@Entity
@Table(name = "txn_product")
public class TxnProduct implements Serializable {
	private static final long serialVersionUID = 1L;
	private int id;
	private Product product;
	private Transaction transaction;
	private int quantity;
	private BigDecimal unitPrice;

	public TxnProduct() {
	}

	public int getQuantity() {
		return this.quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	@Column(name = "unit_price")
	public BigDecimal getUnitPrice() {
		return this.unitPrice;
	}

	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	// bi-directional many-to-one association to Product
	@ManyToOne(fetch = FetchType.LAZY)
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	// bi-directional many-to-one association to Transaction
	@ManyToOne(fetch = FetchType.LAZY)
	public Transaction getTransaction() {
		return this.transaction;
	}

	public void setTransaction(Transaction transaction) {
		this.transaction = transaction;
	}

}